package com.zhongchaowuye.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.zhongchaowuye.dao.LoginDao;
import com.zhongchaowuye.pojo.Login;
import com.zhongchaowuye.service.LoginService;

@Transactional
@Service("loginService")
public class LoginServiceImpl implements LoginService{
	@Resource
	LoginDao loginDao;
	
	@Override
	public int insertLogin(Login l) {
		// TODO Auto-generated method stub
		return loginDao.insertLogin(l);
	}

	@Override
	public int updateLogin(Login l) {
		// TODO Auto-generated method stub
		return loginDao.updateLogin(l);
	}

	@Override
	public int delLogin(Login l) {
		// TODO Auto-generated method stub
		return loginDao.delLogin(l);
	}
	
	@Override
	public Login getLogin(Login l) {
		// TODO Auto-generated method stub
		return loginDao.getLogin(l);
	}
	
	@Override
	public List<Map<String, Object>> getLoginList(Login l) {
		// TODO Auto-generated method stub
		PageHelper.startPage(l.getPageIndex(),l.getPageSize(),true);
		return loginDao.getLoginList(l);
	}

	@Override
	public Login getLoginByUandP(Login l) {
		// TODO Auto-generated method stub
		return loginDao.getLoginByUandP(l);
	}

	@Override
	public int changePwd(Login l) {
		// TODO Auto-generated method stub
		return loginDao.changePwd(l);
	}
}
